<template>
  <div class="app-container">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column
        prop="id"
        label="日志ID"
        width="60px"
        overflow:hidden
        :show-overflow-tooltip="true"
        align="center"
      />
      <el-table-column
        prop="content"
        label="内容"
        align="center"
        overflow:hidden
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="clientIp"
        label="客户端请求IP"
        width="120px"
        align="center"
      />
      <el-table-column
        prop="method"
        label="操作方法"
        width="120px"
        align="center"
        overflow:hidden
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="module"
        label="功能模块"
        width="120px"
        align="center"
      />

      <el-table-column
        prop="operator"
        label="操作者"
        width="90px"
        align="center"
      />
      <el-table-column
        prop="operatorId"
        label="操作者ID"
        width="90px"
        align="center"
      />
      <el-table-column
        prop="startTime"
        label="开始时间"
        width="180px"
        align="center"
      />
      <el-table-column  width="100px" align="center"
        ><template #default="scope">
          <!-- <el-button type="text" size="mini" icon="View" @click="handleUpdate(scope.row)"
            >查看更多</el-button
          >  -->
          <router-link
            :to="'/system/logs-data/index/' + scope.row.id "
            class="link-type"
            icon="View"
          >
            <span>查看更多</span>
          </router-link>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="formQuery.pageNum"
      v-model:limit="formQuery.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script setup>
import { listLogs } from "@/api/system/logs";
const formQuery = ref({
  order: "DESC",
  pageNum: 1,
  pageSize: 10,
  sortBy: "id",
});
const total = ref(0);
const tableData = ref();
function getList() {
  listLogs(formQuery.value).then((res) => {
    console.log(res);
    tableData.value = res.content;
    total.value = res.totalElements;
  });
}
getList();
</script>
